package Io;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 666
 * Date: 2023-04-05
 * Time: 16:07
 */
public class test1 {
    public static void main(String[] args) throws IOException {

        try (InputStream  inputStream = new FileInputStream("hello.txt")){
            byte[] buf =new byte[1000];
            int len;
            while (true){
                len =inputStream.read(buf);
                if(len==-1){
                    break;
                }
                for (int i = 0; i < len; i++) {
                    System.out.print((char) buf[i]);
                }
            }

        }
    }
}
